<?php

/**
 * @author PeoneEr
 * @method sql
 */
require_once "core/db.php";


class Mactivatepremium1 extends DB {
    
    private $_query    = NULL;
    private $_fetch = array();

    public function isPremium($login) {
        /**
         * уже премиум?
         * @param string $login
         */
        DB::getInstance()->openConnectionToLS();
        $this->_query = "SELECT `membership` FROM `account_data` WHERE `name` = '$login' ";
        $this->_fetch = mysql_fetch_assoc(DB::getInstance()->sql($this->_query));
        if ($this->_fetch['membership'] > 0) {
            return false;
            DB::getInstance()->closeConnection();
            unset($this->_query, $this->_fetch);
        } else {
            return true;
            DB::getInstance()->closeConnection();
            unset($this->_query, $this->_fetch);
        }
    }


}

?>